package war2100.editor;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;

import war2100.Editor;
import war2100.entity.tiles.*;

public class TileChoice extends JPanel {
	private static final long serialVersionUID = -6772276896362045428L;
	private Editor editor;
	
	public TileChoice(Editor editor) {
		this.editor = editor;
		
		JPanel p = new JPanel();
		this.setLayout(new BorderLayout());
		this.add(new JLabel("  Tile-Auswahl"), BorderLayout.NORTH);
		this.add(p);
		
		p.setLayout(new GridLayout(0,4));
		
		RockTile rock = new RockTile(editor.getPrototypes());
		p.add(new TileChoiceButton(this, rock));
		p.add(new TileChoiceButton(this, new EarthTile(editor.getPrototypes())));
		
		editor.setCurrentSetObject(rock);
	}

	public void setCurrentTile(Tile value) {
		editor.setCurrentSetObject(value);
	}
	
	
}
